package com.springboot2.mapper;

import com.springboot2.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {

    //增
    void add(User user);
    //删
    void del(int id);
    //改
    void update(User user);
    //获取对象
    User findById(int id);
    //分页列表
    List<User> findByPage(Map<String,Integer> map);
    //总记录数
    @Select("select count(*) from user")
    int count();
    //查询条件
    List<User> findByPageParams(Map<String,Object> map );
    //总记
    @Select("select count(*) from user")
    int countParams();

    //登录
    public User login(String name);
    //根据条件查询总数
    int countParamsByName(Map<String, Object> map);
}
